<?php

class Zend_Controller_Action_Helper_Log extends Zend_Controller_Action_Helper_Abstract
{
    function direct($action = '')
    {
    	
  	    $auth = Zend_Auth::getInstance();
        if ($auth->hasIdentity()) {
      		$user_id = $auth->getIdentity()->id;
        } else {
        	$user_id = 0;
        }
      	
        $params["action"] = $action;
        $params["user_id"] = $user_id;
      	$log = new Application_Model_Logs();
      	$log_id = $log->addLog($params);
      	$params["log_id"] = $log_id;
      	
      	if ($user_id > 0) {
	      	$user = new Application_Model_Users();
	      	$user->setLastAction($params);
      	}
      	 
    }
}
?>